LinuxQMISDK-Lite  SLQS04.00.27
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Typedefs | Functions
MbimSyncObject.h File Reference

Go to the source code of this file.

Data Structures

struct  MbimSyncObject
 

Typedefs

typedef struct MbimSyncObject MbimSyncObject
 

Functions

int MbimSyncObject_Initialize (MbimSyncObject *pThis, uint8_t *informationBuffer, uint32_t informationBufferLength)
 
int MbimSyncObject_Destroy (MbimSyncObject *pThis)
 
int MbimSyncObject_Lock (MbimSyncObject *pThis)
 
int MbimSyncObject_Unlock (MbimSyncObject *pThis)
 
int MbimSyncObject_Wait (MbimSyncObject *pThis)
 
int MbimSyncObject_TimedWait (MbimSyncObject *pThis, time_t timeoutSeconds)
 
int MbimSyncObject_Signal (MbimSyncObject *pThis)
 
void MbimSyncObject_DoneCallback (uint32_t status, uint32_t transactionId, uint8_t *informationBuffer, uint32_t informationBufferLength, void *pDoneCallbackContext)
 

Typedef Documentation

This structure is a wrapper around a mutex and condition object and an external buffer. It is a convenience object which may be used to create synchronous MBIM APIs.

Parameters
mutex
  • For thread safety.
condition
  • Triggered on completion.
status
  • The returned MBIM transaction status.
informationBuffer
  • Buffer to which the transaction response's informationBuffer will be copied.
informationBufferLength
  • Set to maximum expected size in bytes of transaction response's informationBuffer. On request completion, it is set to size of transaction response's informationBuffer.

Function Documentation

int MbimSyncObject_Destroy ( MbimSyncObject pThis)

Destroy sync object.

Parameters
[in]pThisThe primary object of this call.
Returns
0 on success, < 0 on failure.
void MbimSyncObject_DoneCallback ( uint32_t  status,
uint32_t  transactionId,
uint8_t *  informationBuffer,
uint32_t  informationBufferLength,
void *  pDoneCallbackContext 
)

This funcion copies MBIM command response's informationBuffer to this object's informationBuffer and signals the waiting thread.

Parameters
[in]statusMBIM status of the MBIM transaction.
[in]transactionIdTransaction ID of associated MBIM transaction.
[in]informationBufferTransaction response's informationBuffer.
[in]informationBufferLengthNumber of bytes in transaction response's informationBuffer.
[in]pDoneCallbackContextPointer to this sync object.
int MbimSyncObject_Initialize ( MbimSyncObject pThis,
uint8_t *  informationBuffer,
uint32_t  informationBufferLength 
)

Initialize sync object.

Parameters
[in]pThis
  • The primary object of this call.
[in]informationBuffer
  • Buffer to which the transaction response's informationBuffer will be copied.
[in]informationBufferLength
  • Maximum expected size in bytes of transaction response's informationBuffer.
Returns
0 on success, < 0 on failure.
int MbimSyncObject_Lock ( MbimSyncObject pThis)

Lock sync object.

Parameters
[in]pThisThe primary object of this call.
Returns
0 on success, < 0 on failure.
int MbimSyncObject_Signal ( MbimSyncObject pThis)

Signal sync object. Waiting thread should wake up.

Parameters
[in]pThisThe primary object of this call.
Returns
0 on success, ETIMEDOUT on timeout, or other negative on failure.
int MbimSyncObject_TimedWait ( MbimSyncObject pThis,
time_t  timeoutSeconds 
)

Block, waiting on sync object for a number of seconds.

Parameters
[in]pThisThe primary object of this call.
[in]timeoutSecondsTimeout in seconds before abondoning wait.
Returns
0 on success, < 0 on failure.
int MbimSyncObject_Unlock ( MbimSyncObject pThis)

Unlock sync object.

Parameters
[in]pThisThe primary object of this call.
Returns
0 on success, < 0 on failure.
int MbimSyncObject_Wait ( MbimSyncObject pThis)

Block, waiting on sync object.

Parameters
[in]pThisThe primary object of this call.
Returns
0 on success, < 0 on failure.

Copyright (c) 2011-2015 Sierra Wireless, Inc. All rights reserved